﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace ZombieSurvival
{
    class Player:Character//, IStats
    {
        public Stats PlayerStats { get; private set; }
        public Skills PlayerSkills { get; private set; }
        public Traits PlayerTraits { get; private set; }
        public Mutations PlayerMutations { get; private set; }

        public Player(Stats playerStats, Skills skills, Traits traits)
        {
            PlayerTraits = traits;
            PlayerStats = playerStats;
            PlayerSkills = skills;
        }

        public override void Initialize(Texture2D texture, Vector2 screenposition)
        {
            this.ObjectTexture = texture;
            this.ScreenPosition = screenposition;
        }

        public override void Move(WorldPosition worldPosition)
        {
            this.WorldPosition = worldPosition;
        }

        public override void Move(int direction)
        {
            switch (direction)
            {
                case (int)Enums.Directions.E:
                    this.WorldPosition.XPosition++;
                    break;
                case (int)Enums.Directions.EN:
                    this.WorldPosition.XPosition++;
                    this.WorldPosition.YPosition++;
                    break;
                case (int)Enums.Directions.N:
                    this.WorldPosition.YPosition++;
                    break;
                case (int)Enums.Directions.NW:
                    this.WorldPosition.XPosition--;
                    this.WorldPosition.YPosition++;
                    break;
                case (int)Enums.Directions.S:
                    this.WorldPosition.YPosition--;
                    break;
                case (int)Enums.Directions.SE:
                    this.WorldPosition.XPosition++;
                    this.WorldPosition.YPosition--;
                    break;
                case (int)Enums.Directions.SW:
                    this.WorldPosition.XPosition--;
                    this.WorldPosition.YPosition--;
                    break;
                case (int)Enums.Directions.W:
                    this.WorldPosition.XPosition--;
                    break;
            }
        }

        public override void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(ObjectTexture, ScreenPosition, null, Color.White, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f);
        }

    }
}
